package es.uji.viselab.task;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public abstract class TaskLink {
	protected Set<TaskLinkListener> notifiers = new HashSet<TaskLinkListener>();
	
	public void addListener(TaskLinkListener tll) {
		notifiers.add(tll);
	}
	
	protected void notifyDataArrived() {
		Iterator<TaskLinkListener> itr = notifiers.iterator();

		while (itr.hasNext()) {
			TaskLinkListener tll = itr.next();
			tll.dataArrived();
		}
	}
}
